	function video($field, $value,$isplay = 0) {
global $siteid,$modelid,$id;

    $n = intval($_GET['n']);
	$getf = htmlspecialchars($_GET['f']);
    $id = $id?$id:($this->id?$this->id:($_POST['id']?$_POST['id']:intval($_GET['id'])));
//修正url
if(!$this->data['url'] && $id){
$this->cdb = pc_base::load_model('content_model');
$this->cdb->table_name = str_ireplace('_data','',$this->cdb->table_name);
$ra = $this->cdb->get_one(array('id'=>$id),'url');
}
	$modelid = $modelid?$modelid:$this->modelid;
	$this->fields = $this->fields?$this->fields:getcache('model_field_'.$modelid,'model');//防止动态播放页有静态播放地址
	$this->data['url'] = $this->data['url']?$this->data['url']:$ra['url'];//here get url!
	$cpath = str_replace(APP_PATH,PHPCMS_PATH,substr($this->data['url'],0,strripos($this->data['url'],'/')).'/');
	$catid = $this->catid?$this->catid:intval($_GET['catid']);
	$CATEGORYS = $this->categorys;
	extract($this->data);
	extract(string2array($this->fields[$field]['setting']));//字段设置
	$arrvideo = string2array($value);

if(!$isplay && !$contentplay){
//字段处理
$info = array();
$data = $this->data;
		foreach($this->fields as $f=>$v) {
			if(!isset($data[$f]) || $v['formtype'] == 'video') continue;
			$func = $v['formtype'];
			$vs = $data[$f];
			$result = method_exists($this, $func) ? $this->$func($f,$vs) : $vs;
			if($result !== false) $info[$f] = $result;
		}
@extract($info);
//end
}

	$strvideo = '';
	$this->player = pc_base::load_model('player_model');
	$totelnum = count($arrvideo);//总集数,为1直接显示播放器
	$playerlist = $this->getlist($arrvideo,$ishtml,$purl,$field,$ljf,$fileext,$id,$catid,$n,$isplay,$getf,$cpath);//生成播放列表
	foreach($arrvideo as $k=>$v){
	$vurl = $ishtml?(($purl?$field:'').$ljf.++$k.$fileext):APP_PATH.'index.php?m=content&c=player&catid='.$catid.'&id='.$id.'&f='.$field.'&n='.++$k;//url_rule
$jj = $k+1;
	$nextvurl = $ishtml?(($purl?$field:'').$ljf.$jj.$fileext):APP_PATH.'index.php?m=content&c=player&catid='.$catid.'&id='.$id.'&f='.$field.'&n='.$jj;//url_rule

    $jstitle = $v['alt'];
	$filepath = $v['url'];
	$playerid = $v['p']?$v['p']:8;//8->qvod is default player
	$nextpath = $arrvideo[$k]['url'];
	$nextwebpage = (!$contentplay || $isplay)?( $ishtml?str_replace(PHPCMS_PATH,APP_PATH,$cpath).$nextvurl:$nextvurl ):'';
	if($totelnum == $k) $nextwebpage = $this->data['url'];//最后一集导航到内容页

	$classname = ($n == $k) && ($getf == $field)?' class="currentj"':'';
	$httpvurl = $ishtml?str_replace(PHPCMS_PATH,APP_PATH,$cpath).$vurl:$vurl;
	$httpvurl = $contentplay?'javascript:void();':$httpvurl;
	$otherstr = $contentplay?' onclick="setplayer(\''.$field.'\',\''.$filepath.'\',\''.$nextpath.'\')"':' target="'.($isplay?'_self':'_blank').'"';
	$strvideo .= ($totelnum == 1 && $contentplay)?'':'<a href="'.$httpvurl.'"'.$otherstr.$classname.'>'.$v['alt'].'</a>&nbsp;|&nbsp;';


if($k==1){
	$play = $this->player->get_one(array('playerid'=>$playerid), 'code');
	}
	$playcode = str_ireplace(array('{$filepath}','{$siteurl}','{$nextwebpage}','{$nextpath}'),array((!$isplay && $contentplay)?$arrvideo[0]['url']:$filepath,APP_PATH,$nextwebpage,$nextpath),$play['code']);

if(!$contentplay){
	$seo_keywords = is_array($keywords)?implode(',',$keywords):$keywords;
    $SEO = seo($siteid, $catid, $title.$v['alt'].$field, $description, $seo_keywords);
	}

//create_html
if(!$isplay && $ishtml && !$n && !$contentplay){
	$file = $cpath.$vurl;
ob_start();
include template('content', 'player');
		$data = ob_get_contents();
		ob_clean();
		$dir = dirname($file);
		if(!is_dir($dir)) {
			mkdir($dir, 0777,1);
		}
		file_put_contents($file, $data);
		@chmod($file,0777);
		if(!is_writable($file)) {
			$file = str_replace(PHPCMS_PATH,'',$file);
			showmessage(L('file').'：'.$file.'<br>'.L('not_writable'));
		}
		}
//create_html end
}
    $palystr = '<div id="'.$field.'playcode">'.$playcode.'</div>';
	$strvideo = $strvideo?$strvideo:'';
	return '<div id="'.$field.'playa">'.$strvideo.'</div>'.($contentplay?$palystr:'');
	}

	function getlist($arrvideo,$ishtml,$purl,$field,$ljf,$fileext,$id,$catid,$n,$isplay,$getf,$cpath){
	$strvideo = '';
	foreach($arrvideo AS $k=>$v){
$vurl = $ishtml?(($purl?$field:'').$ljf.++$k.$fileext):APP_PATH.'index.php?m=content&c=player&catid='.$catid.'&id='.$id.'&f='.$field.'&n='.++$k;//url_rule

	$classname = ($n == $k) && ($getf == $field)?' class="currentj"':'';
	$httpvurl = $ishtml?str_replace(PHPCMS_PATH,APP_PATH,$cpath).$vurl:$vurl;
	$httpvurl = $contentplay?'javascript:void();':$httpvurl;
	$otherstr = $contentplay?' onclick="setplayer(\''.$field.'\',\''.$filepath.'\',\''.$nextpath.'\')"':' target="'.($isplay?'_self':'_blank').'"';
	$strvideo .= '<a href="'.$httpvurl.'"'.$otherstr.$classname.'>'.$v['alt'].'</a>';

	}
	return $strvideo;
	}